package choice_test;

import java.util.Scanner;

public class java_chapter3_exercise_5 {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		System.out.println("input the first number:");
		int num_1 = in.nextInt();
		System.out.println("input the second number:");
		int num_2 = in.nextInt();
		System.out.println("input the third number:");
		int num_3 = in.nextInt();
		
		if (num_1>num_2 && num_1>num_3) {
//			System.out.printf("max is "+num_1);
//			System.out.println("\n");
		//int a = num_2>num_3 ?num_3:num_2;
//System.out.printf("min is "+(num_2>num_3 ?num_3:num_2));
			//System.out.println(String.format("max is %d,min is %d", num_1,(num_2>num_3 ?num_3:num_2)));
			System.out.printf("max is %d,min is %d",num_1,(num_3<num_2 ?num_3:num_2));
		}
		else if(num_2>num_1 && num_2>num_3) {
			System.out.printf("max is %d,min is %d",num_2,(num_1<num_3? num_1:num_3));
		}
		else {
			System.out.printf("max is %d,min is %d",num_3,(num_1<num_2? num_1:num_2));
		}
				
	}

}
